package com.squid.cloud.common.exception;

import com.squid.cloud.common.enums.ErrorCodeEnum;

public class SquidException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4379420089625178009L;
	public final String errCode;

	public SquidException(String errCode, String msg) {
		super(msg);
		this.errCode = errCode;
	}

	public SquidException(ErrorCodeEnum code) {
		super(code.getDesc());
		this.errCode = code.getCode();
	}

	public SquidException(Exception exc) {
		super(exc.getMessage());
		this.errCode = ErrorCodeEnum.EXCEPTION.getCode();
	}

	public SquidException() {
		super(ErrorCodeEnum.EXCEPTION.getDesc());
		this.errCode = ErrorCodeEnum.EXCEPTION.getCode();
	}

}
